package schema

import (
	"fmt"
)

// 定义表名
const (
	TestTableName = "tests"
)

// Test ...
type Test struct {
	ID       int64 `db:"ID,primarykey,autoincrement"`
	RecordID string
	Name     string
	Created  int64
}

// Validate 验证
func (t *Test) Validate() error {
	if t.Name == "" {
		return fmt.Errorf("请求含有空数据")
	}
	return nil
}

func (t *Test) String() string {
	return jsonMarshal(t)
}
